package edu.spec.wfl.week09.class2.homework.Two;

import java.util.ArrayList;
import java.util.List;

public class Animal {
    private String name;//成员属性1，动物的名字，name，String类型，访问类型为private
    private List sounds;//成员属性2，动物的叫声，sounds，类型为List，sounds用来储存动物的各种叫声，访问类型为private
    private List foods;//成员属性3，动物的食物，foods，类型为List，foods用来存储该动物爱吃的各种食物对象Food，访问类型为private

    //构造方法，自行设计
    public Animal(){}
    public Animal(String name, List sounds, List foods) {
        this.name = name;
        this.sounds = sounds;
        this.foods = foods;
    }
    //成员方法1，void eat()，方法体里输出打印“能吃就能睡”
    void eat(){
        System.out.println("能吃就能睡");
    }
    //成员方法其他，name、sound、food对应的getter和setter
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public List getSounds() {
        return sounds;
    }
    public void setSounds(List sounds) {
        this.sounds = sounds;
    }
    public List getFoods() {
        return foods;
    }
    public void setFoods(List foods) {
        this.foods = foods;
    }

    public void cry() {
    }

    /*
    public static void main(String[] args) {
        List sounds=new ArrayList();
        sounds.add("喵");
        sounds.add("嗷");
        List foods=new ArrayList();
        foods.add(new Food("鱼",10));
        foods.add(new Food("米饭",3));
    }*/
}
